
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module ctb</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>ctb</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/mnt/s/wxaddons/wxctb-0.9/SWIG/ctb.py">/mnt/s/wxaddons/wxctb-0.9/SWIG/ctb.py</a></font></td></tr></table>
    <p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="re.html">re</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
</td><td width="25%" valign=top><a href="wxctb.html">wxctb</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="ctb.html#wxIOBase">wxIOBase</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ctb.html#wxGPIB">wxGPIB</a>
</font></dt><dt><font face="helvetica, arial"><a href="ctb.html#wxSerialPort">wxSerialPort</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="wxGPIB">class <strong>wxGPIB</strong></a>(<a href="ctb.html#wxIOBase">wxIOBase</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt><a href="#wxGPIB">wxGPIB</a>&nbsp;class<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="wxGPIB-GetError"><strong>GetError</strong></a>(self)</dt></dl>

<dl><dt><a name="wxGPIB-GetSTB"><strong>GetSTB</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;value&nbsp;of&nbsp;the&nbsp;internal&nbsp;GPIB&nbsp;status&nbsp;byte&nbsp;register.</tt></dd></dl>

<dl><dt><a name="wxGPIB-Ibrd"><strong>Ibrd</strong></a>(self, length)</dt><dd><tt>#&nbsp;This&nbsp;is&nbsp;only&nbsp;for&nbsp;internal&nbsp;usage!!!</tt></dd></dl>

<dl><dt><a name="wxGPIB-Ibwrt"><strong>Ibwrt</strong></a>(self, string)</dt><dd><tt>#&nbsp;This&nbsp;is&nbsp;only&nbsp;for&nbsp;internal&nbsp;usage!!!</tt></dd></dl>

<dl><dt><a name="wxGPIB-Open"><strong>Open</strong></a>(self, devname, adr)</dt><dd><tt><a href="#wxGPIB-Open">Open</a>(gpibdevice,address)<br>
Opens&nbsp;a&nbsp;connected&nbsp;device&nbsp;at&nbsp;the&nbsp;GPIB&nbsp;bus.&nbsp;gpibdevice&nbsp;means&nbsp;the<br>
controller,&nbsp;(mostly&nbsp;"gpib1"),&nbsp;address&nbsp;the&nbsp;address&nbsp;of&nbsp;the&nbsp;desired<br>
device&nbsp;in&nbsp;the&nbsp;range&nbsp;1...31.&nbsp;For&nbsp;example:<br>
dev&nbsp;=&nbsp;<a href="#wxGPIB">wxGPIB</a>()<br>
dev.<a href="#wxGPIB-Open">Open</a>("gpib1",17)<br>
Opens&nbsp;the&nbsp;device&nbsp;with&nbsp;the&nbsp;address&nbsp;17.<br>
Open&nbsp;returns&nbsp;&gt;=&nbsp;0&nbsp;or&nbsp;a&nbsp;negativ&nbsp;value,&nbsp;if&nbsp;something&nbsp;going&nbsp;wrong.</tt></dd></dl>

<dl><dt><a name="wxGPIB-Reset"><strong>Reset</strong></a>(self)</dt><dd><tt>Resets&nbsp;the&nbsp;connected&nbsp;device.&nbsp;In&nbsp;the&nbsp;GPIB&nbsp;definition,&nbsp;the&nbsp;device<br>
should&nbsp;be&nbsp;reset&nbsp;to&nbsp;it's&nbsp;initial&nbsp;state,&nbsp;so&nbsp;you&nbsp;can&nbsp;restart&nbsp;a<br>
formely&nbsp;lost&nbsp;communication.</tt></dd></dl>

<dl><dt><a name="wxGPIB-ResetBus"><strong>ResetBus</strong></a>(self)</dt><dd><tt>The&nbsp;command&nbsp;asserts&nbsp;the&nbsp;GPIB&nbsp;interface&nbsp;clear&nbsp;(IFC)&nbsp;line&nbsp;for<br>
ast&nbsp;least&nbsp;100us&nbsp;if&nbsp;the&nbsp;GPIB&nbsp;board&nbsp;is&nbsp;the&nbsp;system&nbsp;controller.<br>
This&nbsp;initializes&nbsp;the&nbsp;GPIB&nbsp;and&nbsp;makes&nbsp;the&nbsp;interface&nbsp;CIC&nbsp;and<br>
active&nbsp;controller&nbsp;with&nbsp;ATN&nbsp;asserted.<br>
Note!&nbsp;The&nbsp;IFC&nbsp;signal&nbsp;resets&nbsp;only&nbsp;the&nbsp;GPIB&nbsp;interface&nbsp;functions<br>
of&nbsp;the&nbsp;bus&nbsp;devices&nbsp;and&nbsp;not&nbsp;the&nbsp;internal&nbsp;device&nbsp;functions.<br>
For&nbsp;a&nbsp;device&nbsp;reset&nbsp;you&nbsp;should&nbsp;use&nbsp;the&nbsp;<a href="#wxGPIB-Reset">Reset</a>()&nbsp;command&nbsp;above.</tt></dd></dl>

<dl><dt><a name="wxGPIB-__del__"><strong>__del__</strong></a>(self)</dt></dl>

<dl><dt><a name="wxGPIB-__init__"><strong>__init__</strong></a>(self)</dt></dl>

<hr>
Methods inherited from <a href="ctb.html#wxIOBase">wxIOBase</a>:<br>
<dl><dt><a name="wxGPIB-Close"><strong>Close</strong></a>(self)</dt></dl>

<dl><dt><a name="wxGPIB-GetTimeout"><strong>GetTimeout</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;internal&nbsp;timeout&nbsp;value&nbsp;in&nbsp;milliseconds</tt></dd></dl>

<dl><dt><a name="wxGPIB-Ioctl"><strong>Ioctl</strong></a>(self, cmd, arg)</dt></dl>

<dl><dt><a name="wxGPIB-PutBack"><strong>PutBack</strong></a>(self, char)</dt></dl>

<dl><dt><a name="wxGPIB-Read"><strong>Read</strong></a>(self, length)</dt><dd><tt>Try&nbsp;to&nbsp;read&nbsp;the&nbsp;given&nbsp;count&nbsp;of&nbsp;data&nbsp;(length)&nbsp;and&nbsp;returns&nbsp;the<br>
successfully&nbsp;readed&nbsp;number&nbsp;of&nbsp;data.&nbsp;The&nbsp;function&nbsp;never&nbsp;blocks.<br>
For&nbsp;example:<br>
readed&nbsp;=&nbsp;dev.<a href="#wxGPIB-Read">Read</a>(100)</tt></dd></dl>

<dl><dt><a name="wxGPIB-ReadBinary"><strong>ReadBinary</strong></a>(self, eos<font color="#909090">='<font color="#c040c0">\n</font>'</font>)</dt><dd><tt>Special&nbsp;SCPI&nbsp;command.&nbsp;Read&nbsp;the&nbsp;next&nbsp;data&nbsp;coded&nbsp;as&nbsp;a&nbsp;SCPI<br>
binary&nbsp;format.<br>
A&nbsp;binary&nbsp;data&nbsp;transfer&nbsp;will&nbsp;be&nbsp;startet&nbsp;by&nbsp;'#'.&nbsp;The&nbsp;next&nbsp;byte<br>
tells&nbsp;the&nbsp;count&nbsp;of&nbsp;bytes&nbsp;for&nbsp;the&nbsp;binary&nbsp;length&nbsp;header,<br>
following&nbsp;by&nbsp;the&nbsp;length&nbsp;bytes.&nbsp;After&nbsp;these&nbsp;the&nbsp;data&nbsp;begins.<br>
For&nbsp;example:<br>
#500004xxxx<br>
The&nbsp;header&nbsp;length&nbsp;covers&nbsp;5&nbsp;Byte,&nbsp;the&nbsp;length&nbsp;of&nbsp;the&nbsp;binary<br>
data&nbsp;is&nbsp;4&nbsp;(x&nbsp;means&nbsp;the&nbsp;binary&nbsp;data&nbsp;bytes)</tt></dd></dl>

<dl><dt><a name="wxGPIB-ReadUntilEOS"><strong>ReadUntilEOS</strong></a>(self, eos<font color="#909090">='<font color="#c040c0">\n</font>'</font>, quota<font color="#909090">=0</font>)</dt><dd><tt><a href="#wxGPIB-ReadUntilEOS">ReadUntilEOS</a>(eosString="\n",timeout=1000)<br>
Reads&nbsp;data&nbsp;until&nbsp;the&nbsp;given&nbsp;eos&nbsp;string&nbsp;was&nbsp;received&nbsp;(default&nbsp;is<br>
the&nbsp;linefeed&nbsp;character&nbsp;(0x0a)&nbsp;or&nbsp;the&nbsp;internal&nbsp;timeout<br>
(default&nbsp;1000ms)&nbsp;was&nbsp;reached.<br>
ReadUntilEOS&nbsp;returns&nbsp;the&nbsp;result&nbsp;as&nbsp;the&nbsp;following&nbsp;tuple:<br>
['received&nbsp;string',state,readedBytes]<br>
If&nbsp;a&nbsp;timeout&nbsp;occurred,&nbsp;state&nbsp;is&nbsp;0,&nbsp;otherwise&nbsp;1</tt></dd></dl>

<dl><dt><a name="wxGPIB-Readv"><strong>Readv</strong></a>(self, length)</dt><dd><tt>Try&nbsp;to&nbsp;read&nbsp;the&nbsp;given&nbsp;count&nbsp;of&nbsp;data.&nbsp;Readv&nbsp;blocks&nbsp;until&nbsp;all&nbsp;data<br>
was&nbsp;readed&nbsp;successfully&nbsp;or&nbsp;the&nbsp;internal&nbsp;timeout,&nbsp;set&nbsp;with&nbsp;the<br>
class&nbsp;member&nbsp;function&nbsp;<a href="#wxGPIB-SetTimeout">SetTimeout</a>(timeout),&nbsp;was&nbsp;reached.<br>
Returns&nbsp;the&nbsp;readed&nbsp;data.</tt></dd></dl>

<dl><dt><a name="wxGPIB-SetTimeout"><strong>SetTimeout</strong></a>(self, timeout)</dt><dd><tt>Set&nbsp;the&nbsp;internal&nbsp;timeout&nbsp;value&nbsp;in&nbsp;milliseconds&nbsp;for&nbsp;all&nbsp;blocked<br>
operations&nbsp;like&nbsp;ReadUntilEOS,&nbsp;Readv&nbsp;and&nbsp;Writev.</tt></dd></dl>

<dl><dt><a name="wxGPIB-Write"><strong>Write</strong></a>(self, string)</dt><dd><tt>Writes&nbsp;the&nbsp;given&nbsp;string&nbsp;to&nbsp;the&nbsp;device&nbsp;and&nbsp;returns&nbsp;immediately.<br>
Write&nbsp;returns&nbsp;the&nbsp;number&nbsp;of&nbsp;data&nbsp;bytes&nbsp;successfully&nbsp;written&nbsp;or&nbsp;a<br>
negativ&nbsp;number&nbsp;if&nbsp;an&nbsp;error&nbsp;occured.&nbsp;For&nbsp;some&nbsp;circumstances,&nbsp;not<br>
the&nbsp;complete&nbsp;string&nbsp;was&nbsp;written.<br>
So&nbsp;you&nbsp;have&nbsp;to&nbsp;verify&nbsp;the&nbsp;return&nbsp;value&nbsp;to&nbsp;check&nbsp;this&nbsp;out.</tt></dd></dl>

<dl><dt><a name="wxGPIB-Writev"><strong>Writev</strong></a>(self, string)</dt><dd><tt>Writes&nbsp;the&nbsp;given&nbsp;string&nbsp;to&nbsp;the&nbsp;device.&nbsp;The&nbsp;function&nbsp;blocks&nbsp;until<br>
the&nbsp;complete&nbsp;string&nbsp;was&nbsp;written&nbsp;or&nbsp;the&nbsp;internal&nbsp;timeout,&nbsp;set&nbsp;with<br>
<a href="#wxGPIB-SetTimeout">SetTimeout</a>(timeout),&nbsp;was&nbsp;reached.<br>
Writev&nbsp;returns&nbsp;the&nbsp;number&nbsp;of&nbsp;data&nbsp;successfully&nbsp;written&nbsp;or&nbsp;a<br>
negativ&nbsp;value,&nbsp;if&nbsp;an&nbsp;errors&nbsp;occurred.</tt></dd></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="wxIOBase">class <strong>wxIOBase</strong></a></font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="wxIOBase-Close"><strong>Close</strong></a>(self)</dt></dl>

<dl><dt><a name="wxIOBase-GetTimeout"><strong>GetTimeout</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;internal&nbsp;timeout&nbsp;value&nbsp;in&nbsp;milliseconds</tt></dd></dl>

<dl><dt><a name="wxIOBase-Ioctl"><strong>Ioctl</strong></a>(self, cmd, arg)</dt></dl>

<dl><dt><a name="wxIOBase-Open"><strong>Open</strong></a>(self)</dt></dl>

<dl><dt><a name="wxIOBase-PutBack"><strong>PutBack</strong></a>(self, char)</dt></dl>

<dl><dt><a name="wxIOBase-Read"><strong>Read</strong></a>(self, length)</dt><dd><tt>Try&nbsp;to&nbsp;read&nbsp;the&nbsp;given&nbsp;count&nbsp;of&nbsp;data&nbsp;(length)&nbsp;and&nbsp;returns&nbsp;the<br>
successfully&nbsp;readed&nbsp;number&nbsp;of&nbsp;data.&nbsp;The&nbsp;function&nbsp;never&nbsp;blocks.<br>
For&nbsp;example:<br>
readed&nbsp;=&nbsp;dev.<a href="#wxIOBase-Read">Read</a>(100)</tt></dd></dl>

<dl><dt><a name="wxIOBase-ReadBinary"><strong>ReadBinary</strong></a>(self, eos<font color="#909090">='<font color="#c040c0">\n</font>'</font>)</dt><dd><tt>Special&nbsp;SCPI&nbsp;command.&nbsp;Read&nbsp;the&nbsp;next&nbsp;data&nbsp;coded&nbsp;as&nbsp;a&nbsp;SCPI<br>
binary&nbsp;format.<br>
A&nbsp;binary&nbsp;data&nbsp;transfer&nbsp;will&nbsp;be&nbsp;startet&nbsp;by&nbsp;'#'.&nbsp;The&nbsp;next&nbsp;byte<br>
tells&nbsp;the&nbsp;count&nbsp;of&nbsp;bytes&nbsp;for&nbsp;the&nbsp;binary&nbsp;length&nbsp;header,<br>
following&nbsp;by&nbsp;the&nbsp;length&nbsp;bytes.&nbsp;After&nbsp;these&nbsp;the&nbsp;data&nbsp;begins.<br>
For&nbsp;example:<br>
#500004xxxx<br>
The&nbsp;header&nbsp;length&nbsp;covers&nbsp;5&nbsp;Byte,&nbsp;the&nbsp;length&nbsp;of&nbsp;the&nbsp;binary<br>
data&nbsp;is&nbsp;4&nbsp;(x&nbsp;means&nbsp;the&nbsp;binary&nbsp;data&nbsp;bytes)</tt></dd></dl>

<dl><dt><a name="wxIOBase-ReadUntilEOS"><strong>ReadUntilEOS</strong></a>(self, eos<font color="#909090">='<font color="#c040c0">\n</font>'</font>, quota<font color="#909090">=0</font>)</dt><dd><tt><a href="#wxIOBase-ReadUntilEOS">ReadUntilEOS</a>(eosString="\n",timeout=1000)<br>
Reads&nbsp;data&nbsp;until&nbsp;the&nbsp;given&nbsp;eos&nbsp;string&nbsp;was&nbsp;received&nbsp;(default&nbsp;is<br>
the&nbsp;linefeed&nbsp;character&nbsp;(0x0a)&nbsp;or&nbsp;the&nbsp;internal&nbsp;timeout<br>
(default&nbsp;1000ms)&nbsp;was&nbsp;reached.<br>
ReadUntilEOS&nbsp;returns&nbsp;the&nbsp;result&nbsp;as&nbsp;the&nbsp;following&nbsp;tuple:<br>
['received&nbsp;string',state,readedBytes]<br>
If&nbsp;a&nbsp;timeout&nbsp;occurred,&nbsp;state&nbsp;is&nbsp;0,&nbsp;otherwise&nbsp;1</tt></dd></dl>

<dl><dt><a name="wxIOBase-Readv"><strong>Readv</strong></a>(self, length)</dt><dd><tt>Try&nbsp;to&nbsp;read&nbsp;the&nbsp;given&nbsp;count&nbsp;of&nbsp;data.&nbsp;Readv&nbsp;blocks&nbsp;until&nbsp;all&nbsp;data<br>
was&nbsp;readed&nbsp;successfully&nbsp;or&nbsp;the&nbsp;internal&nbsp;timeout,&nbsp;set&nbsp;with&nbsp;the<br>
class&nbsp;member&nbsp;function&nbsp;<a href="#wxIOBase-SetTimeout">SetTimeout</a>(timeout),&nbsp;was&nbsp;reached.<br>
Returns&nbsp;the&nbsp;readed&nbsp;data.</tt></dd></dl>

<dl><dt><a name="wxIOBase-ResetBus"><strong>ResetBus</strong></a>(self)</dt><dd><tt>If&nbsp;the&nbsp;underlaying&nbsp;interface&nbsp;needs&nbsp;some&nbsp;special&nbsp;reset&nbsp;operations<br>
(for&nbsp;instance&nbsp;the&nbsp;GPIB&nbsp;distinguish&nbsp;between&nbsp;a&nbsp;normal&nbsp;device&nbsp;reset<br>
and&nbsp;a&nbsp;special&nbsp;bus&nbsp;reset),&nbsp;you&nbsp;can&nbsp;put&nbsp;some&nbsp;code&nbsp;here)</tt></dd></dl>

<dl><dt><a name="wxIOBase-SetTimeout"><strong>SetTimeout</strong></a>(self, timeout)</dt><dd><tt>Set&nbsp;the&nbsp;internal&nbsp;timeout&nbsp;value&nbsp;in&nbsp;milliseconds&nbsp;for&nbsp;all&nbsp;blocked<br>
operations&nbsp;like&nbsp;ReadUntilEOS,&nbsp;Readv&nbsp;and&nbsp;Writev.</tt></dd></dl>

<dl><dt><a name="wxIOBase-Write"><strong>Write</strong></a>(self, string)</dt><dd><tt>Writes&nbsp;the&nbsp;given&nbsp;string&nbsp;to&nbsp;the&nbsp;device&nbsp;and&nbsp;returns&nbsp;immediately.<br>
Write&nbsp;returns&nbsp;the&nbsp;number&nbsp;of&nbsp;data&nbsp;bytes&nbsp;successfully&nbsp;written&nbsp;or&nbsp;a<br>
negativ&nbsp;number&nbsp;if&nbsp;an&nbsp;error&nbsp;occured.&nbsp;For&nbsp;some&nbsp;circumstances,&nbsp;not<br>
the&nbsp;complete&nbsp;string&nbsp;was&nbsp;written.<br>
So&nbsp;you&nbsp;have&nbsp;to&nbsp;verify&nbsp;the&nbsp;return&nbsp;value&nbsp;to&nbsp;check&nbsp;this&nbsp;out.</tt></dd></dl>

<dl><dt><a name="wxIOBase-Writev"><strong>Writev</strong></a>(self, string)</dt><dd><tt>Writes&nbsp;the&nbsp;given&nbsp;string&nbsp;to&nbsp;the&nbsp;device.&nbsp;The&nbsp;function&nbsp;blocks&nbsp;until<br>
the&nbsp;complete&nbsp;string&nbsp;was&nbsp;written&nbsp;or&nbsp;the&nbsp;internal&nbsp;timeout,&nbsp;set&nbsp;with<br>
<a href="#wxIOBase-SetTimeout">SetTimeout</a>(timeout),&nbsp;was&nbsp;reached.<br>
Writev&nbsp;returns&nbsp;the&nbsp;number&nbsp;of&nbsp;data&nbsp;successfully&nbsp;written&nbsp;or&nbsp;a<br>
negativ&nbsp;value,&nbsp;if&nbsp;an&nbsp;errors&nbsp;occurred.</tt></dd></dl>

<dl><dt><a name="wxIOBase-__del__"><strong>__del__</strong></a>(self)</dt></dl>

<dl><dt><a name="wxIOBase-__init__"><strong>__init__</strong></a>(self)</dt></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="wxSerialPort">class <strong>wxSerialPort</strong></a>(<a href="ctb.html#wxIOBase">wxIOBase</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="wxSerialPort-ChangeLineState"><strong>ChangeLineState</strong></a>(self, lineState)</dt><dd><tt>Change&nbsp;(toggle)&nbsp;the&nbsp;state&nbsp;of&nbsp;each&nbsp;the&nbsp;lines&nbsp;given&nbsp;in&nbsp;the<br>
linestate&nbsp;parameter.&nbsp;Possible&nbsp;values&nbsp;are&nbsp;wxSERIAL_LINESTATE_DTR<br>
(means&nbsp;the&nbsp;DTR&nbsp;signal)&nbsp;and/or&nbsp;wxSERIAL_LINESTATE_RTS&nbsp;(RTS&nbsp;signal).<br>
For&nbsp;example&nbsp;to&nbsp;toggle&nbsp;the&nbsp;RTS&nbsp;line&nbsp;only:<br>
dev.<a href="#wxSerialPort-ChangeLineState">ChangeLineState</a>(wxSERIAL_LINESTATE_RTS)</tt></dd></dl>

<dl><dt><a name="wxSerialPort-ClrLineState"><strong>ClrLineState</strong></a>(self, lineState)</dt><dd><tt>Clear&nbsp;the&nbsp;lines&nbsp;given&nbsp;in&nbsp;the&nbsp;linestate&nbsp;parameter.&nbsp;Possible<br>
values&nbsp;are&nbsp;wxSERIAL_LINESTATE_DTR&nbsp;(means&nbsp;the&nbsp;DTR&nbsp;signal)&nbsp;and/or<br>
wxSERIAL_LINESTATE_RTS&nbsp;(RTS&nbsp;signal).&nbsp;For&nbsp;example&nbsp;to&nbsp;clear&nbsp;only<br>
the&nbsp;RTS&nbsp;line:<br>
dev.<a href="#wxSerialPort-ClrLineState">ClrLineState</a>(wxSERIAL_LINESTATE_RTS)</tt></dd></dl>

<dl><dt><a name="wxSerialPort-GetAvailableBytes"><strong>GetAvailableBytes</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;available&nbsp;bytes&nbsp;in&nbsp;the&nbsp;input&nbsp;queue&nbsp;of&nbsp;the&nbsp;serial<br>
driver.</tt></dd></dl>

<dl><dt><a name="wxSerialPort-GetCommErrors"><strong>GetCommErrors</strong></a>(self)</dt><dd><tt>Get&nbsp;the&nbsp;internal&nbsp;communication&nbsp;errors&nbsp;like&nbsp;breaks,&nbsp;framing,<br>
parity&nbsp;or&nbsp;overrun&nbsp;errors.<br>
Returns&nbsp;the&nbsp;count&nbsp;of&nbsp;each&nbsp;error&nbsp;as&nbsp;a&nbsp;tuple&nbsp;like&nbsp;this:<br>
(b,f,o,p)&nbsp;=&nbsp;dev.<a href="#wxSerialPort-GetCommErrors">GetCommErrors</a>()<br>
b:&nbsp;breaks,&nbsp;f:&nbsp;framing&nbsp;errors,&nbsp;&nbsp;o:&nbsp;overruns,&nbsp;p:&nbsp;parity&nbsp;errors</tt></dd></dl>

<dl><dt><a name="wxSerialPort-GetLineState"><strong>GetLineState</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;current&nbsp;linestates&nbsp;of&nbsp;the&nbsp;CTS,&nbsp;DCD,&nbsp;DSR&nbsp;and&nbsp;RING<br>
signal&nbsp;line&nbsp;as&nbsp;an&nbsp;integer&nbsp;value&nbsp;with&nbsp;the&nbsp;appropriate&nbsp;bits&nbsp;or<br>
-1&nbsp;on&nbsp;error.<br>
For&nbsp;example:<br>
lines&nbsp;=&nbsp;dev.<a href="#wxSerialPort-GetLineState">GetLineState</a>()<br>
if&nbsp;lines&nbsp;&amp;&nbsp;wxSERIAL_LINESTATE_CTS:<br>
&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;"CTS&nbsp;is&nbsp;on"</tt></dd></dl>

<dl><dt><a name="wxSerialPort-Open"><strong>Open</strong></a>(self, devname, baudrate, protocol<font color="#909090">='8N1'</font>, handshake<font color="#909090">='no_handshake'</font>)</dt><dd><tt>Open&nbsp;the&nbsp;device&nbsp;devname&nbsp;with&nbsp;the&nbsp;given&nbsp;baudrate,&nbsp;the&nbsp;protocol<br>
like&nbsp;'8N1'&nbsp;(default)&nbsp;and&nbsp;the&nbsp;use&nbsp;of&nbsp;the&nbsp;handshake&nbsp;[no_handshake<br>
(default),&nbsp;rtscts&nbsp;or&nbsp;xonxoff]<br>
For&nbsp;example:<br>
At&nbsp;Linux:<br>
dev&nbsp;=&nbsp;<a href="#wxSerialPort">wxSerialPort</a>()<br>
dev.<a href="#wxSerialPort-Open">Open</a>("/dev/ttyS0",115200)<br>
or&nbsp;with&nbsp;a&nbsp;datalen&nbsp;of&nbsp;7&nbsp;bits,&nbsp;even&nbsp;parity,&nbsp;2&nbsp;stopbits&nbsp;and&nbsp;rts/cts<br>
handshake:<br>
dev.<a href="#wxSerialPort-Open">Open</a>("/dev/ttyS0",115200,'7E2',True)<br>
At&nbsp;Windows:<br>
dev&nbsp;=&nbsp;<a href="#wxSerialPort">wxSerialPort</a>()<br>
dev.<a href="#wxSerialPort-Open">Open</a>("COM1",115200)<br>
dev.<a href="#wxSerialPort-Open">Open</a>("COM1",115200,'7E2',True)<br>
Returns&nbsp;the&nbsp;handle&nbsp;on&nbsp;success&nbsp;or&nbsp;a&nbsp;negativ&nbsp;value&nbsp;on&nbsp;failure.</tt></dd></dl>

<dl><dt><a name="wxSerialPort-Reset"><strong>Reset</strong></a>(self)</dt><dd><tt>Send&nbsp;a&nbsp;break&nbsp;for&nbsp;0.25s.</tt></dd></dl>

<dl><dt><a name="wxSerialPort-SetBaudRate"><strong>SetBaudRate</strong></a>(self, baudrate)</dt><dd><tt>Set&nbsp;the&nbsp;baudrate&nbsp;for&nbsp;the&nbsp;device.</tt></dd></dl>

<dl><dt><a name="wxSerialPort-SetLineState"><strong>SetLineState</strong></a>(self, lineState)</dt><dd><tt>Set&nbsp;the&nbsp;lines&nbsp;given&nbsp;in&nbsp;the&nbsp;linestate&nbsp;parameter.&nbsp;Possible<br>
values&nbsp;are&nbsp;wxSERIAL_LINESTATE_DTR&nbsp;(means&nbsp;the&nbsp;DTR&nbsp;signal)&nbsp;and/or<br>
wxSERIAL_LINESTATE_RTS&nbsp;(RTS&nbsp;signal).&nbsp;For&nbsp;example&nbsp;to&nbsp;set&nbsp;both:<br>
dev.<a href="#wxSerialPort-SetLineState">SetLineState</a>(wxSERIAL_LINESTATE_DTR&nbsp;|&nbsp;wxSERIAL_LINESTATE_RTS)</tt></dd></dl>

<dl><dt><a name="wxSerialPort-__del__"><strong>__del__</strong></a>(self)</dt></dl>

<dl><dt><a name="wxSerialPort-__init__"><strong>__init__</strong></a>(self)</dt></dl>

<hr>
Methods inherited from <a href="ctb.html#wxIOBase">wxIOBase</a>:<br>
<dl><dt><a name="wxSerialPort-Close"><strong>Close</strong></a>(self)</dt></dl>

<dl><dt><a name="wxSerialPort-GetTimeout"><strong>GetTimeout</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;internal&nbsp;timeout&nbsp;value&nbsp;in&nbsp;milliseconds</tt></dd></dl>

<dl><dt><a name="wxSerialPort-Ioctl"><strong>Ioctl</strong></a>(self, cmd, arg)</dt></dl>

<dl><dt><a name="wxSerialPort-PutBack"><strong>PutBack</strong></a>(self, char)</dt></dl>

<dl><dt><a name="wxSerialPort-Read"><strong>Read</strong></a>(self, length)</dt><dd><tt>Try&nbsp;to&nbsp;read&nbsp;the&nbsp;given&nbsp;count&nbsp;of&nbsp;data&nbsp;(length)&nbsp;and&nbsp;returns&nbsp;the<br>
successfully&nbsp;readed&nbsp;number&nbsp;of&nbsp;data.&nbsp;The&nbsp;function&nbsp;never&nbsp;blocks.<br>
For&nbsp;example:<br>
readed&nbsp;=&nbsp;dev.<a href="#wxSerialPort-Read">Read</a>(100)</tt></dd></dl>

<dl><dt><a name="wxSerialPort-ReadBinary"><strong>ReadBinary</strong></a>(self, eos<font color="#909090">='<font color="#c040c0">\n</font>'</font>)</dt><dd><tt>Special&nbsp;SCPI&nbsp;command.&nbsp;Read&nbsp;the&nbsp;next&nbsp;data&nbsp;coded&nbsp;as&nbsp;a&nbsp;SCPI<br>
binary&nbsp;format.<br>
A&nbsp;binary&nbsp;data&nbsp;transfer&nbsp;will&nbsp;be&nbsp;startet&nbsp;by&nbsp;'#'.&nbsp;The&nbsp;next&nbsp;byte<br>
tells&nbsp;the&nbsp;count&nbsp;of&nbsp;bytes&nbsp;for&nbsp;the&nbsp;binary&nbsp;length&nbsp;header,<br>
following&nbsp;by&nbsp;the&nbsp;length&nbsp;bytes.&nbsp;After&nbsp;these&nbsp;the&nbsp;data&nbsp;begins.<br>
For&nbsp;example:<br>
#500004xxxx<br>
The&nbsp;header&nbsp;length&nbsp;covers&nbsp;5&nbsp;Byte,&nbsp;the&nbsp;length&nbsp;of&nbsp;the&nbsp;binary<br>
data&nbsp;is&nbsp;4&nbsp;(x&nbsp;means&nbsp;the&nbsp;binary&nbsp;data&nbsp;bytes)</tt></dd></dl>

<dl><dt><a name="wxSerialPort-ReadUntilEOS"><strong>ReadUntilEOS</strong></a>(self, eos<font color="#909090">='<font color="#c040c0">\n</font>'</font>, quota<font color="#909090">=0</font>)</dt><dd><tt><a href="#wxSerialPort-ReadUntilEOS">ReadUntilEOS</a>(eosString="\n",timeout=1000)<br>
Reads&nbsp;data&nbsp;until&nbsp;the&nbsp;given&nbsp;eos&nbsp;string&nbsp;was&nbsp;received&nbsp;(default&nbsp;is<br>
the&nbsp;linefeed&nbsp;character&nbsp;(0x0a)&nbsp;or&nbsp;the&nbsp;internal&nbsp;timeout<br>
(default&nbsp;1000ms)&nbsp;was&nbsp;reached.<br>
ReadUntilEOS&nbsp;returns&nbsp;the&nbsp;result&nbsp;as&nbsp;the&nbsp;following&nbsp;tuple:<br>
['received&nbsp;string',state,readedBytes]<br>
If&nbsp;a&nbsp;timeout&nbsp;occurred,&nbsp;state&nbsp;is&nbsp;0,&nbsp;otherwise&nbsp;1</tt></dd></dl>

<dl><dt><a name="wxSerialPort-Readv"><strong>Readv</strong></a>(self, length)</dt><dd><tt>Try&nbsp;to&nbsp;read&nbsp;the&nbsp;given&nbsp;count&nbsp;of&nbsp;data.&nbsp;Readv&nbsp;blocks&nbsp;until&nbsp;all&nbsp;data<br>
was&nbsp;readed&nbsp;successfully&nbsp;or&nbsp;the&nbsp;internal&nbsp;timeout,&nbsp;set&nbsp;with&nbsp;the<br>
class&nbsp;member&nbsp;function&nbsp;<a href="#wxSerialPort-SetTimeout">SetTimeout</a>(timeout),&nbsp;was&nbsp;reached.<br>
Returns&nbsp;the&nbsp;readed&nbsp;data.</tt></dd></dl>

<dl><dt><a name="wxSerialPort-ResetBus"><strong>ResetBus</strong></a>(self)</dt><dd><tt>If&nbsp;the&nbsp;underlaying&nbsp;interface&nbsp;needs&nbsp;some&nbsp;special&nbsp;reset&nbsp;operations<br>
(for&nbsp;instance&nbsp;the&nbsp;GPIB&nbsp;distinguish&nbsp;between&nbsp;a&nbsp;normal&nbsp;device&nbsp;reset<br>
and&nbsp;a&nbsp;special&nbsp;bus&nbsp;reset),&nbsp;you&nbsp;can&nbsp;put&nbsp;some&nbsp;code&nbsp;here)</tt></dd></dl>

<dl><dt><a name="wxSerialPort-SetTimeout"><strong>SetTimeout</strong></a>(self, timeout)</dt><dd><tt>Set&nbsp;the&nbsp;internal&nbsp;timeout&nbsp;value&nbsp;in&nbsp;milliseconds&nbsp;for&nbsp;all&nbsp;blocked<br>
operations&nbsp;like&nbsp;ReadUntilEOS,&nbsp;Readv&nbsp;and&nbsp;Writev.</tt></dd></dl>

<dl><dt><a name="wxSerialPort-Write"><strong>Write</strong></a>(self, string)</dt><dd><tt>Writes&nbsp;the&nbsp;given&nbsp;string&nbsp;to&nbsp;the&nbsp;device&nbsp;and&nbsp;returns&nbsp;immediately.<br>
Write&nbsp;returns&nbsp;the&nbsp;number&nbsp;of&nbsp;data&nbsp;bytes&nbsp;successfully&nbsp;written&nbsp;or&nbsp;a<br>
negativ&nbsp;number&nbsp;if&nbsp;an&nbsp;error&nbsp;occured.&nbsp;For&nbsp;some&nbsp;circumstances,&nbsp;not<br>
the&nbsp;complete&nbsp;string&nbsp;was&nbsp;written.<br>
So&nbsp;you&nbsp;have&nbsp;to&nbsp;verify&nbsp;the&nbsp;return&nbsp;value&nbsp;to&nbsp;check&nbsp;this&nbsp;out.</tt></dd></dl>

<dl><dt><a name="wxSerialPort-Writev"><strong>Writev</strong></a>(self, string)</dt><dd><tt>Writes&nbsp;the&nbsp;given&nbsp;string&nbsp;to&nbsp;the&nbsp;device.&nbsp;The&nbsp;function&nbsp;blocks&nbsp;until<br>
the&nbsp;complete&nbsp;string&nbsp;was&nbsp;written&nbsp;or&nbsp;the&nbsp;internal&nbsp;timeout,&nbsp;set&nbsp;with<br>
<a href="#wxSerialPort-SetTimeout">SetTimeout</a>(timeout),&nbsp;was&nbsp;reached.<br>
Writev&nbsp;returns&nbsp;the&nbsp;number&nbsp;of&nbsp;data&nbsp;successfully&nbsp;written&nbsp;or&nbsp;a<br>
negativ&nbsp;value,&nbsp;if&nbsp;an&nbsp;errors&nbsp;occurred.</tt></dd></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-GetKey"><strong>GetKey</strong></a>()</dt><dd><tt>Returns&nbsp;the&nbsp;current&nbsp;pressed&nbsp;key&nbsp;or&nbsp;' ',&nbsp;if&nbsp;no&nbsp;key&nbsp;is&nbsp;pressed.<br>
You&nbsp;can&nbsp;simply&nbsp;create&nbsp;a&nbsp;query&nbsp;loop&nbsp;with:<br>
while&nbsp;<a href="#-GetKey">GetKey</a>()&nbsp;==&nbsp;' ':<br>
&nbsp;&nbsp;&nbsp;&nbsp;...&nbsp;make&nbsp;some&nbsp;stuff&nbsp;...</tt></dd></dl>
 <dl><dt><a name="-abstract"><strong>abstract</strong></a>()</dt></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>wxSERIAL_LINESTATE_CTS</strong> = 32<br>
<strong>wxSERIAL_LINESTATE_DCD</strong> = 64<br>
<strong>wxSERIAL_LINESTATE_DSR</strong> = 256<br>
<strong>wxSERIAL_LINESTATE_DTR</strong> = 2<br>
<strong>wxSERIAL_LINESTATE_NULL</strong> = 0<br>
<strong>wxSERIAL_LINESTATE_RING</strong> = 128<br>
<strong>wxSERIAL_LINESTATE_RTS</strong> = 4</td></tr></table>
</body></html>